using System.Web.Mvc;
using System.Web.UI;

namespace MvcSupplantCaching
{
    /// <summary>
    /// The interface for the <see cref="SupplantOutputCacheAttribute" />.
    /// </summary>
    public interface ISupplantOutputCacheAttribute
    {
        /// <summary>
        /// Gets or sets the cache duration, in seconds.
        /// </summary>
        int Duration { get; set; }

        /// <summary>
        /// Gets or sets the vary-by-param value.
        /// </summary>
        string VaryByParam { get; set; }

        /// <summary>
        /// Gets or sets the vary-by-custom value.
        /// </summary>
        string VaryByCustom { get; set; }

        /// <summary>
        /// Gets or sets the cache profile name.
        /// </summary>
        string CacheProfile { get; set; }

        /// <summary>
        /// Gets or sets the location.
        /// </summary>
        OutputCacheLocation Location { get; set; }

        /// <summary>
        /// Gets or sets a value that indicates whether to store the cache.
        /// </summary>
        bool NoStore { get; set; }

        /// <summary>
        /// Get or sets the <see cref="OutputCacheOptions"/> for this attributes. Specifying a value here will
        /// make the <see cref="OutputCache.DefaultOptions"/> value ignored.
        /// </summary>
        OutputCacheOptions Options { get; set; }

        /// <summary>
        /// The CacheSettings for the attribute.
        /// </summary>
        /// <returns></returns>
        /// <exception cref="System.Web.HttpException">
        /// The 'duration' attribute must have a value that is greater than or equal to zero.
        /// </exception>
        CacheSettings CacheSettings { get; }

        /// <summary>
        /// Gets the cache key that represents the provided <see cref="ControllerContext"/>.
        /// </summary>
        /// <param name="controllerContext">The context to get the cache key for.</param>
        /// <returns>A cache key.</returns>
        string GetCacheKeyForController(ControllerContext controllerContext);
    }
}